<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@taglib prefix="pageFunc" uri="http://java.sun.com/jsp/jstl/core"%>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>News</title>
        <link href="css/style.css" rel="stylesheet" type="text/css" />
        <link rel="stylesheet" type="text/css" href="css/menu.css"/>
        <script type="text/javascript">
            function SelectText(id)
            {
                document.getElementById(id).focus();
                document.getElementById(id).select();
            }
            var i = 0;
            window.setInterval(function() {
                document.getElementById("bannerImg").src = "images/banner"+i+".jpg";
                i++;
                if (i==5) i = 0;
            }, 3000);
            function MM_jumpMenu(targ,selObj,restore){ //v3.0
                eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
                if (restore) selObj.selectedIndex=0;
            }
            function aboutUsClick(){
                alert('Do something else...\nWhat do you want to know more about us?\n Go to contact page please!');	
            }
        </script>
    </head>

    <body>
        <div id="container">
            <div id="logo">
                <img src="images/logo_top.gif" width="500" height="62" alt="logo" />
            </div>
            <div id="login">
                <!-- ######################### User Login Module ######################## -->
                <pageFunc:set var="user" value="${sessionScope.USER}"/>
                <pageFunc:if test="${empty user}">
                    <form action="UserController" method="POST">
                        <div id="login">
                            <br/><span class="loginText">Username</span>
                            <input id="txtUsername" onclick="SelectText('txtUsername')" name="txtUsername" type="text" maxlength="20" width="100px"/>
                            <br/><span class="loginText">Password</span>
                            <input id="txtPassword" onclick="SelectText('txtPassword')" name="txtPassword" type="password" maxlength="20" width="100px"/>
                            <br/>
                            <input type="submit" class="inputBtn" value="Login" name="btnAction" />
                            <input type="submit" class="inputBtn" value="Forgot Password ?" name="btnAction" />
                            <input type="button" class="inputBtn" value="Register" name="btnAction" onclick="location.href='user.jsp'"/>
                        </div>
                    </form>
                </pageFunc:if>   
                <pageFunc:if test="${not empty user}">                    

                    <pageFunc:url var="editUser" value="UserController">
                        <pageFunc:param name="btnAction" value="AccountSetting"/>
                    </pageFunc:url>
                    <br/><span class="loginText">
                        <a class="linkLoginText" style="width:40px;" href="${editUser}">Welcome! ${user.getID()}</a>
                    </span>

                    <pageFunc:url var="logout" value="UserController">
                        <pageFunc:param name="btnAction" value="Log Out"/>
                    </pageFunc:url>
                    <a class="linkLoginText" style="width:40px;" href="${logout}">Log Out</a>
                </pageFunc:if>
            </div>
            <!-- *************************** End User Login Module ********************************* -->
            <div id="banner">
                <img src="images/banner2.jpg" name="bannerImg" width="760" height="210" id="bannerImg" />
            </div>
            <div id="menu">
                <ul class="navigation">
                    <li><a href="index.jsp"><em class="home"></em><b>Home</b></a></li>
                    <li class="current"><a href="news.jsp"><em class="templates"></em><b>News</b></a></li>
                    <li><a href="user.jsp"><em class="psd"></em><b>User</b></a></li>
                    <li><a href="catalogue.jsp"><em class="tutorials"></em><b>Catalogue</b></a></li>
                    <li><a href="shoppingcart.jsp"><em class="shop"></em><b>Shopping cart</b></a></li>
                    <li><a href="contact.jsp"><em class="contact"></em><b>Contact Us</b></a></li>
                </ul>
            </div>
            <div id="main">
                <div style="width:100%;float:left;margin:30px;">
                    <img src="images/1.jpg" width="100" height="100" align="left" style="padding-right:30px;"/>
                    News 1 content... Contents of news...blah blah...
                    <a href="#">More</a>
                </div>
                <div style="width:100%;float:left;margin:30px;">
                    <img src="images/2.jpg" width="100" height="100" align="left" style="padding-right:30px;"/>
                    News 1 content... Contents of news...blah blah...
                    <a href="#">More</a>
                </div>
                <div style="width:100%;float:left;margin:30px;">
                    <img src="images/3.jpg" width="100" height="100" align="left" style="padding-right:30px;"/>
                    News 1 content... Contents of news...blah blah...
                    <a href="#">More</a>
                </div>
                <div style="width:100%;float:left;margin:30px;">
                    <img src="images/4.jpg" width="100" height="100" align="left" style="padding-right:30px;"/>
                    News 1 content... Contents of news...blah blah...
                    <a href="#">More</a>
                </div>
            </div>
            <div id="footer" class="navigation">
                <span style="margin-top:10px">Copyright by LocHT. All right reserved.</span>
            </div>
        </div>
    </body>
</html>
